<?php
    header("content-type:text/html;charset=utf8");
    $conn=new Mysqli("localhost","root","root","db_bailian");
    Mysqli_set_charset($conn,'utf8');
    if($conn->connect_errno){
        die("数据库连接失败！");
    }
    $sql="select  count(title) as 'num'  from t_brands where type_id=4";
    $res=$conn->query($sql);
    $row=Mysqli_fetch_assoc($res);
    $result=json_encode($row);
    echo $result;
?>